﻿module FSEvent
(* this module concentrates definitions of CLI events (and their arguments), which are triggered from the FS code *)

(* Event args of the commandGraphUpdated event. c is the relevant command and g is the updated graph attached to 
   the command, ct is command text, only one pf the two is valid(g or ct) *)
type CommandGraphUpdatedEventArgs(c : CoreEx.Cmd, g : CG.graph, ct : string) = 
    inherit System.EventArgs()
    member x.Command = c
    member x.Graph = g
    member x.GraphExist = (ct.Equals(""))
    member x.CmdText = ct
    member x.CmdTextExist = (ct.Equals("").Equals(false))

(* Event args of the debugInfoAdded event. 'text' is the debug information that was added. *)
type DebugInfoAddedEventArgs(text : string) = 
    inherit System.EventArgs()
    member x.Text = text

(* This event is triggered when a command graph of some command was updated. *)
let commandGraphUpdated = new Event<CommandGraphUpdatedEventArgs>()

(* This event is triggered when ever  debug information is added. *)
let debugInfoAdded = new Event<DebugInfoAddedEventArgs>()
